Fix Non Invertible Matrix Issue - Compute Flattening #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Issue:
Upon running the script_orbifold_sphere command, the following error occured (details below). The root cause was identified in the computeFlattening.m script, where the inverse of matrix M is multiplied by matrix rhs. Matrix M is not invertible, leading to the propagation of a NaN matrix x_lambda until the script fails at an assertion.
Matrix M:
size: 5328 x 5328
rank: 5320 (deficient)
determinant: NaN
Proposed Solution:
By using Tikhonov Regularization, the 0 values within Matrix M are shifted by a small constant (alpha : 1e-10) . This in turn fixes the rank deficiency problem and successfully runs the following 3 scripts
Verified Scripts:
1. script_orbifold_sphere
2. script_orbifold_disk
3. script_NOT_ORBIFOLD_spherical_tutte
Remaining Observations:
The calculated determinant of M still appears to be unstable even after regularization (Inf). However, the linear constraint checks defined in the script have passed.
Original Error Message: